<?php

namespace api\controller;

use common\controller\VerifyController;
use common\service\EditProjectService;
use think\Exception;
use think\Request;
use think\Response;
use Throwable;

class EditProjectController extends VerifyController
{
    /**
     * @var EditProjectService
     */
    private $editProjectService;

    public function __construct()
    {
        parent::__construct();
        $this->editProjectService = EditProjectService::getInstance();
    }

    /**
     * 剪辑工程上传
     * @param Request $request
     * @return Response
     * @throws Throwable
     * @throws Exception
     */
    public function upload(Request $request)
    {
        $data = $request->param()['data'];
        $res = $this->editProjectService->upload($data);
        return json(success_response('OK', $res));
    }

    /**
     * 查询列表
     * @param Request $request
     * @return Response
     * @throws \Exception
     */
    public function select(Request $request)
    {
        $param = $request->param()['param'];
        $res = $this->editProjectService->select($param);
        return json(success_response('OK', $res));
    }
}
